home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-01-27 | 878 b | 29 lines | [TEXT/MPS ] |
- # This adjusts the width of a DITL item by the amount requested symmetrically
- # The cursor must be somewhere on the line containing the boundary Rectangle
- # Frank Alviani - Monday, January 26, 1987 2:17:29 PM
-
- set exit 0
- set dir "`request -d w '<W>iden | <N>arrow?'`"
- exit if ({dir} == "") OR ({status} != 0)
- set amt "`request -d 10 'Amount to adjust?'`"
- exit if ({amt} == "") OR ({status} != 0)
- find ¡0¡0 "{active}" #ensure we're @ start of line
-
- find /∂{[0-9]+,/Δ:Δ/,/ "{active}" #find left coord
- set t `catenate "{active}".§`
- if {dir} =~ /≈[Ww]≈/
- set top `evaluate {t} - ({amt} ÷ 2)`
- else
- set top `evaluate {t} + ({amt} ÷ 2)`
- end
- replace § {top} "{active}"
-
- find /,[0-9]+,/Δ:Δ/∂}/ "{active}" #find right coord
- set t `catenate "{active}".§`
- if {dir} =~ /≈[Ww]≈/
- set top `evaluate {t} + ({amt} ÷ 2)`
- else
- set top `evaluate {t} - ({amt} ÷ 2)`
- end
- replace § {top} "{active}"
-